# 提供了创建web服务器的功能
from http.server import HTTPServer, BaseHTTPRequestHandler


# 编写请求处理
class RequseCallBack(BaseHTTPRequestHandler):
    def do_GET(self):
        print("收到请求")

    def do_POST(self):
        print("收到post请求")


# 构造http服务器对象
saddr = ("192.168.12.19", 4396)
server = HTTPServer(saddr, RequseCallBack)
server.serve_forever()
print("服务器启动了")